package schoolDemo3;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class App4_6 {
    public static void main(String[] args) {
        int a=0,b=1,n,num;
        String str = null;
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("请输入一个正整数：");
        try {
            str=buf.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        num=Integer.parseInt(str);
        while (b<num)
        {
            n=a+b;
            a=b;
            b=n;
        }
        if (num==b) System.out.println(num+"是斐波那契数");
        else System.out.println(num+"不是菲波那切数");
    }
}
